package com.action;


import com.pojo.Student;
import com.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/stu")
@RestController
public class StudentAction {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/add")
    public String add(Student stu)
    {
        studentService.add(stu);
        return "success";
    }

    @RequestMapping("/del")
    public String del(int id)
    {
        studentService.del(id);
        return "success";
    }

    @RequestMapping("/search")
    public List search(String keyword, int page, int size)
    {
        return studentService.search(keyword,page,size);
    }
}
